from django.contrib import admin
# ...
from .models import Author
from .models import Book

# 注册模型
# Register your models here.

# admin模块中
class AuthorAdmin(admin.ModelAdmin):
    # 继承父类类属性   [私有属性不能被继承]
    list_display = ["authorname","gender","age"]
    # 过滤
    list_filter = ["gender"]
    # 搜索栏
    search_fields = ["authorname"]
# admin.site.register(Author)
admin.site.register(Author,AuthorAdmin)

# 注册Book
class BookAdmin(admin.ModelAdmin):
    # 显示列头:名称/出版日期/类别
    list_display = ["bookname","publishtime","kind"]
# admin.site.register(Book)
admin.site.register(Book,BookAdmin)